/**
 * API request and response types
 */

export interface ApiResponse<T = any> {
  code: number;
  data: T;
  message: string;
  timestamp: number;
}

export interface PaginationParams {
  page: number;
  pageSize: number;
  sortBy?: string;
  sortOrder?: 'asc' | 'desc';
  search?: string;
}

export interface PaginationResponse<T = any> {
  items: T[];
  total: number;
  page: number;
  pageSize: number;
  totalPages: number;
}

export interface ErrorResponse {
  code: number;
  message: string;
  details?: Record<string, any>;
  requestId?: string;
  timestamp: number;
}

export interface FileUploadResponse {
  id: string;
  filename: string;
  originalName: string;
  size: number;
  mimeType: string;
  uploadedAt: string;
  url?: string;
}

export interface GenerationStatusResponse {
  taskId: string;
  status: string;
  currentStep: string;
  progress: number;
  estimatedTimeRemaining?: number;
}

export interface WebSocketMessage<T = any> {
  type: string;
  data: T;
  timestamp: number;
}